<template>
  <!--表单子控件的导出属性-->
  <el-input
    type="textarea"
    :rows="29"
    v-model="json"
  />
</template>

<script>
  import { defineComponent, computed } from 'vue'
  import { ElInput } from 'element-plus'
  import { getItemState } from './state-item'
  // 格式化
  // import objectFormat from '../json-format/json-format.vue'

  /**
   * 导出表单子控件的模板和 meta （js和json格式）
   */
  export default defineComponent({
    name: 'nf-el-meta-help-item-output',
    inheritAttrs: false,
    components: {
      ElInput
    },
    props: {
      meta: Object
    },
    setup(props) {
      const state = getItemState()
      
      const json = computed(() => JSON.stringify(props.meta, null , 2) )

      return {
        state,
        json
      }
    }
  })

</script>